{extend name="/public/base" /}

{block name="content"}
<!-- Breadcrumb Section Begin -->
<section class="breadcrumb-section set-bg" data-setbg="/static/shop/img/breadcrumb.jpg">
    <div class="container">
        <div class="row">
            <div class="col-lg-12 text-center">
                <div class="breadcrumb__text">
                    <h2>购物车</h2>
                    <div class="breadcrumb__option">
                        <a href="index.html">首页</a>
                        <span>购物车</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- Breadcrumb Section End -->

<!-- Shoping Cart Section Begin -->
<section class="shoping-cart spad">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="shoping__cart__table">
                    <table>
                        <thead>
                        <tr>
                            <th class="shoping__product">商品</th>
                            <th>价格</th>
                            <th>数量</th>
                            <th>总价</th>
                            <th></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td class="shoping__cart__item">
                                <img src="/static/shop/img/cart/cart-1.jpg" alt="">
                                <h5>Vegetable’s Package</h5>
                            </td>
                            <td class="shoping__cart__price">￥55.00</td>
                            <td class="shoping__cart__quantity">
                                <div class="quantity">
                                    <div class="pro-qty">
                                        <input type="text" value="1">
                                    </div>
                                </div>
                            </td>
                            <td class="shoping__cart__total">
                                ￥110.00
                            </td>
                            <td class="shoping__cart__item__close">
                                <span class="icon_close"></span>
                            </td>
                        </tr>
                        <tr>
                            <td class="shoping__cart__item">
                                <img src="/static/shop/img/cart/cart-2.jpg" alt="">
                                <h5>Fresh Garden Vegetable</h5>
                            </td>
                            <td class="shoping__cart__price">
                                ￥39.00
                            </td>
                            <td class="shoping__cart__quantity">
                                <div class="quantity">
                                    <div class="pro-qty">
                                        <input type="text" value="1">
                                    </div>
                                </div>
                            </td>
                            <td class="shoping__cart__total">
                                ￥39.99
                            </td>
                            <td class="shoping__cart__item__close">
                                <span class="icon_close"></span>
                            </td>
                        </tr>
                        <tr>
                            <td class="shoping__cart__item">
                                <img src="/static/shop/img/cart/cart-3.jpg" alt="">
                                <h5>Organic Bananas</h5>
                            </td>
                            <td class="shoping__cart__price">
                                ￥69.00
                            </td>
                            <td class="shoping__cart__quantity">
                                <div class="quantity">
                                    <div class="pro-qty">
                                        <input type="text" value="1">
                                    </div>
                                </div>
                            </td>
                            <td class="shoping__cart__total">
                                ￥69.99
                            </td>
                            <td class="shoping__cart__item__close">
                                <span class="icon_close"></span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="shoping__cart__btns">
                    <a href="#" class="primary-btn cart-btn">继续购物</a>
                    <a href="#" class="primary-btn cart-btn cart-btn-right"><span class="icon_loading"></span>
                        刷新购物车</a>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="shoping__continue">
                    <div class="shoping__discount">
                        <h5>折扣信息</h5>
                        <form action="#">
                            <input type="text" placeholder="请输入优惠券兑换码">
                            <button type="submit" class="site-btn">使用优惠券</button>
                        </form>
                    </div>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="shoping__checkout">
                    <h5>购物车总计</h5>
                    <ul>
                        <li>小计 <span>￥454.98</span></li>
                        <li>优惠 <span>￥ 0.00</span></li>
                        <li>应付 <span>￥454.98</span></li>
                    </ul>
                    <a href="javascript:;" class="primary-btn" id="pay">立即支付</a>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- Shoping Cart Section End -->
{/block}
{block name="js"}
<script>
    $('#pay').click(function () {

        $.ajax({
            'type': 'post',
            'data': {id: 1},
            'url': '/shop/aliPay',
            success: function (res) {
                if (res.code === 0) {
                    // console.log(res.data.form)
                    layer.open({
                        title: false,
                        type: 1,
                        content: res.data.form,
                        // area: ['500px', '500px'],
                        // closeBtn: 0,
                        shade: 0,
                        // shadeClose: true,
                        // end: function () {
                        //     var handle_status = $("#handle_status").val();
                        //     if (handle_status == 1) {
                        //         layer.msg('登陆成功！');
                        //     } else if (handle_status == 2) {
                        //         layer.msg('注册成功');
                        //     }
                        // }
                    });
                } else {
                    layer.msg('发起支付失败');
                }
            }
        });
    });
</script>

{/block}
